package com.youlu.campus.entity;

import com.youlu.campus.base.base.EntityBase;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * 电子证书订单
 */
@Getter
@Setter
@Document(collection = "digital_ca_order")
@CompoundIndexes({
        @CompoundIndex(name = "digital_ca_comIdx",def = "{'userId':1,'caType':1,'caLevel':1," +
                "'activityId':1}")
})
public class DigitalCaOrder extends EntityBase {

    /**
     * 订单号
     */
    @Indexed(unique = true)
    private String orderNo;

    private Integer totalPrice;

    @Indexed
    private String activityId;

    private String activityName;
    /**
     * 姓名
     */
    @Indexed
    private String name;

    /**
     * 手机号
     */
    @Indexed
    private String mobile;

    private String userId;

    /**
     * 用户openId QQ微信h5支付 才会返回
     */
    private String openId;
    /**
     * appId
     */
    private String appId;

    /**
     * 平台
     */
    private String platform;
    /**
     * 支付回调交易ID
     */
    private String transactionId;

    /**
     * 客户端ID
     */
    private String clientIp;

    private String merchantId;
    /**
     * 商户名:梦想跳动、国际路有、春芽，厚山
     */
    private String merchantName;

    private String caLevel;

    private String caType;

    /**
     * 0 未支付 1 已支付
     */
    private Integer status =0;

    /**
     * 支付时间
     */
    protected Date payTime;


    private String universityId;

    private String universityName;

    private Integer sharingProfitAmount;

    /**
     * 分账状态
     * 0：待处理
     * 1: 已分账
     * 2:关闭
     * 3:取消
     * 4:已退回
     * 5:不分账
     *
     */
    @Transient
    private Integer sharingProfitStatus =0;


}
